#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(int argc, const char *argv[])
{
	int ch;

	while((ch = getchar())!=EOF)
	{
		if(isalpha(ch))
		{
			if(isupper(ch))
				ch = tolower(ch);
			else if(islower(ch))
				ch = toupper(ch);
		}
		putchar(ch);
	}
	return 0;
}
